﻿using Nemerle.Collections;
using Nemerle.Text;
using Nemerle.Utility;

using System;
using System.Collections.Generic;
using System.Linq;
using Nemerle2.Compiler;

namespace DocBrowser
{
  /// <summary>
  /// Description of Metadata.
  /// </summary>
  public variant Metadata
  {
    | Namespace { Name : string; TypeInfos : ReadOnlyArray[ITypeInfo]; MacroInfos : ReadOnlyArray[IMacroInfo]; }
    | Assembly  { Value : IReferencedAssembly; }
    | TypeInfo  { Value : ITypeInfo; }
    | MacroInfo { Value : IMacroInfo; }
    
    public override ToString() : string
    {
      match (this)
      {
        | Namespace(name, _, _) => $"namespace $name"
        | Assembly(assembly)    => assembly.ToString()
        | TypeInfo(type)        => type.ToString()
        | MacroInfo(m)          => m.ToString()
      }
    }
  }
}
